package ase.assignment.sts.ws.beans;

public class WSUtil {
	public static ase.assignment.sts.beans.CustomerEntity convert(
			CustomerEntity entity) {
		ase.assignment.sts.beans.CustomerEntity bean = new ase.assignment.sts.beans.CustomerEntity(
				entity.getName());
		bean.setPassword(entity.getPassword());
		bean.setEmail(entity.getEmail());
		return bean;
	}

	public static CustomerEntity convert(
			ase.assignment.sts.beans.CustomerEntity bean) {
		CustomerEntity entity = new CustomerEntity();
		entity.setName(bean.getName());
		entity.setPassword(bean.getPassword());
		entity.setEmail(bean.getEmail());
		return entity;
	}

	public static ase.assignment.sts.beans.PortfolioEntity convert(
			PortfolioEntity entity) {
		ase.assignment.sts.beans.PortfolioEntity bean = new ase.assignment.sts.beans.PortfolioEntity(
				entity.getId());
		bean.setName(entity.getName());
		bean.setCustomerName(entity.getCustomerName());
		return bean;
	}

	public static PortfolioEntity convert(
			ase.assignment.sts.beans.PortfolioEntity bean) {
		PortfolioEntity entity = new PortfolioEntity();
		entity.setId(bean.getId());
		entity.setName(bean.getName());
		entity.setCustomerName(bean.getCustomerName());
		return entity;
	}

	public static ase.assignment.sts.beans.StockAssertEntity convert(
			StockAssertEntity entity) {
		ase.assignment.sts.beans.StockAssertEntity bean = new ase.assignment.sts.beans.StockAssertEntity(
				entity.getId());
		bean.setName(entity.getName());
		bean.setAmount(entity.getAmount());
		bean.setInitPrice(entity.getInitPrice());
		bean.setPortfolio(entity.getPortfolio());
		return bean;
	}

	public static StockAssertEntity convert(
			ase.assignment.sts.beans.StockAssertEntity bean) {
		StockAssertEntity entity = new StockAssertEntity();
		entity.setId(bean.getId());
		entity.setName(bean.getName());
		entity.setAmount(bean.getAmount());
		entity.setInitPrice(bean.getInitPrice());
		entity.setPortfolio(bean.getPortfolio());
		return entity;
	}
}
